package com.example.rizhaoscienceandtechnologymuseum.Utils;

import java.util.ArrayList;
import java.util.List;

/**
 *人脸库存类
 */
public class FaceStock {
    private  List<byte[]> colorList = new ArrayList<>(5);
    private  List<byte[]> redList = new ArrayList<>(5);
    private boolean allowPutFlag = true;
    public void setColorList(byte[] colorByte){
        if(colorList.size() < 5){
            colorList.add(colorByte);
        }else{
            colorList.remove(0);
            colorList.add(colorByte);
        }
    }

    public void setRedList(byte[] redByte){
        if(redList.size() < 5){
            redList.add(redByte);
        }else{
            redList.remove(0);
            redList.add(redByte);
        }
    }

    public void setAllowPutFlag(boolean allowPutFlag){
        this.allowPutFlag = allowPutFlag;
    }

    public boolean getAllowPutFlag(){
        return allowPutFlag;
    }

    public int getColorListSize(){
        return colorList.size();
    }

    public int getRedListSize(){
        return colorList.size();
    }

    public List<byte[]> getColorList(){
        return colorList;
    }

    public List<byte[]> getRedList(){
        return redList;
    }

    public void clearStock(){
        this.colorList.clear();
        this.redList.clear();
    }
}
